package com.koron.housing.contract.bean.po;

import com.koron.bean.annocation.FillField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 发票报销(HousingContractBill)表实体类
 *
 * @author jzp
 * @since 2022-03-07
 */
@Data
@ApiModel(value = "发票报销", description = "HousingContractBill")
public class HousingContractBill {

    /**
     * ID
     */
    @ApiModelProperty("ID")
    @FillField
    private String id;

    /**
     * 合同id
     */
    @ApiModelProperty("合同id")
    private String contractId;

    /**
     * 合同编号
     */
    @ApiModelProperty("合同编号")
    private String contractCode;

    /**
     * 财务报销编号
     */
    @ApiModelProperty("财务报销编号")
    private String billCode;

    /**
     * 房源id
     */
    @ApiModelProperty("房源id")
    private String housingId;

    /**
     * 房号
     */
    @ApiModelProperty("房号")
    private String roomNum;

    /**
     * 租金
     */
    @ApiModelProperty("租金")
    private Double rent;

    /**
     * 年份
     */
    @ApiModelProperty("年份")
    private Integer year;

    /**
     * 月份
     */
    @ApiModelProperty("月份")
    private Integer month;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @FillField
    private Date createTime;

    /**
     * 用于附件的bizId
     */
    public String getBizId() {
        return getBillCode() + getYear() + String.format("%02d", getMonth());
    }
}

